package org.makabaka.wfwwb.common;

import org.makabaka.wfwwb.pojo.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(value = ServiceException.class)
    @ResponseBody
    public Result ServiceRightExceptionHandler(ServiceException e) {

        return Result.error(e.getCode(), e.getMessage());
    }



}
